<?php $msgs = Yii::app()->user->getFlash('msgs'); ?>
         <!-- START OF MAINCOL -->
          <div class="MainCol AM_BookPage">

              <h1 class="left">在线问吧管理</h1>

              <br class="clear" />

              <span class="NormalFont SmallFont">
                  <a href="<?php echo Yii::app()->baseUrl; ?>" title="home"><?= CHtml::image(Yii::app()->baseUrl.'/images/home_icon.gif', '主页'); ?></a> > 在线问吧 > 在线问吧管理 > 回复管理
               </span><br /><br />

              <div class="Titlebox box"><!-- DON'T DELETE --></div>

              <?php if(isset($msgs['save'])) : ?>
              <div class="SuccessfulBox Smallbox">
                <span class="Successful"> <?php echo $msgs['save']; ?> </span>
              </div>
              <?php endif; ?>

              <?php if(Yii::app()->user->hasFlash('message')) : ?>
              <div class="SuccessfulBox Smallbox">
                <span class="Successful"> <?php echo Yii::app()->user->getFlash('message'); ?></span>
              </div>
              <?php endif; ?>

              <div class="DisplayBox_top Smallbox">

              	  <b class="left SmallFont">以下是对 “<?php echo htmlspecialchars($qa->qaTitle) ?>” 的回复。</a>共 <span class="Blue"><?php echo count($replies); ?></span> 条记录。</b>

                  <br class="clear" />
              </div>

              <ul class="Lists Smallbox">
              <?php foreach($replies as $k => $reply) { ?>
              	  <li <?php if($k%2 == 1) { ?>class="ThinGrey_bg"<?php } ?>>

                      <span class="ContentBox">
                          <p class="Smallbox">
	                          	<b><?php echo $reply->qaTitle; ?></b>
                          </p>

                          <p class="Smallbox">
							  <label>作者</label>: <a href="<?php echo CHtml::normalizeUrl(array('/users/viewprofile', 'id' => $reply->qaAuthor)) ?>" target="_blank" class="BlueLink"><?php echo $reply->author->userName(); ?></a><br />
							  <label>回复内容</label>: <span class="reply-content" id="reply_content_<?php echo $reply->qaId ?>"><?php echo htmlspecialchars($reply->qaContent); ?></span><br />
                          <label><?php echo $reply->qaStatus == QAs::STATUS_UNSOLVED ? CHtml::link('回复', array('/qas/view/id/'.$reply->qaId), array('class' => 'BlueLink', 'target' => '_blank')) : '&nbsp;'; ?>&nbsp;</label><br />
                          </p>
                      </span>
                      <br class="clear" />

                      <span class="Rated"><?php echo CHtml::link('删除', array('/admin/qas/delete/id/'.$reply->qaId), array('confirm' => '确定要删除这条回复吗？', 'class' => 'Delete')); ?></span>
                </li>
                <?php } ?>

              </ul>


              <div class="DisplayBox_btm">

              	  <b class="left SmallFont">共 <span class="Blue"><?php echo count($replies); ?></span> 条记录。</b>

                  <br class="clear" />
              </div>

        </div>
          <!-- END OF MAINCOL -->
<script type="text/javascript">
$(document).ready(function() {
	$('.reply-content').editable('<?php echo $this->createAbsoluteUrl('/admin/qas/editreplycontent') ?>', {
         type      : 'textarea',
         cancel    : '取消',
		 width	   : '420px',
		 height    : '72px',
         submit    : '确定',
         indicator : '<img src="<?php echo Yii::app()->baseUrl.'/images/ajax-loader.gif' ?>">',
         tooltip   : '单击进行编辑...'
     });
});
</script>